#include "ball.h"

const double P=sqrt(2.0);    //半径
const int Ball::Colors[]={
    Qt::green,
    Qt::blue,
    Qt::yellow,
    Qt::darkGray,
    Qt::darkRed,
    Qt::lightGray,
    Qt::darkCyan,
    Qt::darkYellow,
    Qt::darkMagenta,
    Qt::darkGreen
};

void Ball::initball(int type1){
    type=type1;
    size=(int)(8*pow(P,type1));
    mass=(int)(pow(1.5,type1));
    color=Colors[type1];
    vx=vy=ax=ay=0;  //初始速度、加速度为0
    falling=0;
}
